/**
 * user模块接口列表
 */
import request from '@/js/request.js'; // 导入http中创建的axios实例


const user = {

    /**
     * 用户登录
     * @param loginParams
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    loginUser(loginParams){
        return request({
            url: '/user/login',
            method: 'post',
            data: {
                userName: loginParams.email,
                emailCode: loginParams.emailCode
            }
        })
    },

    /**
     * 用户登出
     * @param userId
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    logout(userId){
        return request(`/user/logout?userId=${userId}`)
    }

}

export default user;
